<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# OPTIONS_GHC -fno-warn-unused-imports #-}</span><span>
</span><span id="line-4"></span><span>
</span><span id="line-5"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.Compat.FilePath</span><span>
</span><span id="line-6"></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#isExtensionOf"><span class="hs-identifier">isExtensionOf</span></a></span><span>
</span><span id="line-7"></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#stripExtension"><span class="hs-identifier">stripExtension</span></a></span><span>
</span><span id="line-8"></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.OldList.html#isSuffixOf"><span class="hs-identifier">isSuffixOf</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.OldList.html#stripPrefix"><span class="hs-identifier">stripPrefix</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-11"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.html#"><span class="hs-identifier">System.FilePath</span></a></span><span class="hs-cpp">

#if !MIN_VERSION_filepath(1,4,2)
</span><span class="hs-identifier">isExtensionOf</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">String</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">FilePath</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Bool</span><span>
</span><span id="line-15"></span><span class="hs-identifier">isExtensionOf</span><span> </span><span class="hs-identifier">ext</span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="hs-char">'.'</span><span class="hs-glyph">:</span><span class="hs-identifier">_</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">isSuffixOf</span><span> </span><span class="hs-identifier">ext</span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-identifier">takeExtensions</span><span>
</span><span id="line-16"></span><span class="hs-identifier">isExtensionOf</span><span> </span><span class="hs-identifier">ext</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">isSuffixOf</span><span> </span><span class="hs-special">(</span><span class="hs-char">'.'</span><span class="hs-glyph">:</span><span class="hs-identifier">ext</span><span class="hs-special">)</span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-identifier">takeExtensions</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">
#if !MIN_VERSION_filepath(1,4,1)
</span><span class="hs-identifier">stripExtension</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">String</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">FilePath</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">FilePath</span><span>
</span><span id="line-21"></span><span class="hs-identifier">stripExtension</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>        </span><span class="hs-identifier">path</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Just</span><span> </span><span class="hs-identifier">path</span><span>
</span><span id="line-22"></span><span class="hs-identifier">stripExtension</span><span> </span><span class="hs-identifier">ext</span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="hs-identifier">x</span><span class="hs-glyph">:</span><span class="hs-identifier">_</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">path</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">stripSuffix</span><span> </span><span class="hs-identifier">dotExt</span><span> </span><span class="hs-identifier">path</span><span>
</span><span id="line-23"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-24"></span><span>  </span><span class="hs-identifier">dotExt</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="hs-identifier">isExtSeparator</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-keyword">then</span><span> </span><span class="hs-identifier">ext</span><span> </span><span class="hs-keyword">else</span><span> </span><span class="hs-char">'.'</span><span class="hs-glyph">:</span><span class="hs-identifier">ext</span><span>
</span><span id="line-25"></span><span>  </span><span class="hs-identifier">stripSuffix</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Eq</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-identifier">a</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-identifier">a</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-special">[</span><span class="hs-identifier">a</span><span class="hs-special">]</span><span>
</span><span id="line-26"></span><span>  </span><span class="hs-identifier">stripSuffix</span><span> </span><span class="hs-identifier">xs</span><span> </span><span class="hs-identifier">ys</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">fmap</span><span> </span><span class="hs-identifier">reverse</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">stripPrefix</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">reverse</span><span> </span><span class="hs-identifier">xs</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">reverse</span><span> </span><span class="hs-identifier">ys</span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span></pre></body></html>